package utils

import (
	"errors"
	"log"
	"time"
)

const LAYOUT = "2006-01-02 15:04"

// ParseTime 字符串转换time类型
func ParseTime(s string) (time.Time, error) {
	startTime, err := time.Parse(LAYOUT, s)
	if err != nil {
		log.Printf("%v", err.Error())
		return time.Time{}, errors.New("时间解析失败")
	}
	return startTime, nil
}
